$(document).ready(function(){
   $('.sidelinks .item.item-current').parent().prevAll('div').first().find('a').addClass('current');
});

function checkform(obj){
    var validation = $(obj).find(".valid");
    
    var error = false;
    if(validation){
        validation.removeClass('error-ico');
        validation.each(function(index, el){
            if($(this).hasClass('email')){
                validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;
                strEmail = el.value;
                if (strEmail.search(validRegExp) == -1){
                    error = true;
                    $(this).addClass('error-ico');
                }
            }
            else{
                if(!$.trim(el.value)){
                    error = true;
                    $(this).addClass('error-ico');
                }
            }
        });
    }
    var validation = $(obj).find(".thisInt");
    if(validation){
        validation.each(function(index, el){
            if(el.value){
                if(!isThisInt(el.value)){
                    error = true;
                    $(this).addClass('error-ico');
                }
            }
        });
    }
    var validation = $(obj).find(".no-zero");
    if(validation){
        validation.each(function(index, el){
            if(el.value){
                if(!isThisInt(el.value) || el.value < 1){
                    error = true;
                    $(this).addClass('error-ico');
                }
            }
        });
    }
    if(!error){
        var addCheck = $(obj).attr('rel');
        if(addCheck){
            return eval(addCheck+'(obj);');
        }else{
            return true;
        }
    }else{
        return false;
    }
}
function goLink(url){
    window.open(
        url,
        '_blank'
        );
}
function isThisInt (number) {
    return ( !isNaN (number*1))
}